package mands.utils.weather;

/**
 * WeatherForecast.java
 * 
 * @author Maze
 * 
 *         Contains information for a day's weather forecast.
 */
public class WeatherForecast {

	public String day;
	public int highTemperature;
	public int lowTemperature;
	public String weatherCondition;

	public WeatherForecast() {
		day = "";
		highTemperature = 0;
		lowTemperature = 0;
		weatherCondition = "";
	}

	/**
	 * Formats the forecast information into a String.
	 * 
	 * @return Formatted String of weather forecast conditions.
	 */
	public String getFormattedString() {
		String forecast;
		forecast = "Day: " + day + "\n";
		forecast += "Condition: " + weatherCondition + "\n";
		forecast += "High: " + highTemperature + "\n";
		forecast += "Low: " + lowTemperature;

		return forecast;
	}

	/**
	 * Converts the xml information for a day to the text String.
	 * 
	 * @param data
	 * @return
	 */
	public static String dataToString(String data) {

		if (data.equals("Sun")) {
			return "Sunday";
			// return getString(R.string.sunday);
		}
		if (data.equals("Mon")) {
			return "Monday";
		}
		if (data.equals("Tue")) {
			return "Tuesday";
		}
		if (data.equals("Wed")) {
			return "Wednesday";
		}
		if (data.equals("Thu")) {
			return "Thursday";
		}
		if (data.equals("Fri")) {
			return "Friday";
		}
		if (data.equals("Sat")) {
			return "Saturday";
		}
		return "Unknown";
	}

	// Get Methods
	public String getDay() {
		return day.toString();
	}

	public int getHigh() {
		return highTemperature;
	}

	public int getLow() {
		return lowTemperature;
	}

	public String getWeatherCondition() {
		return weatherCondition.toString();
	}
}
